home *** CD-ROM | disk | FTP | other *** search
Wrap
/* $Id: I3DExMdu.h 1.15 1997/06/09 19:54:24 YannPC Exp $ */ /*****************************************************************************\ * * * I3DExMdu.h * * I3DExModule definition * * * * External modules interface * * * * Copyright (c) 1996, Fractal Design Corp. All rights reserved. * * * \*****************************************************************************/ #ifndef __I3DEXMDU__ #define __I3DEXMDU__ #ifndef __I3DEX__ #include "I3DEx.h" #endif #ifndef __I3DSHSCN__ #include "I3DShScn.h" #endif #ifndef __I3DSHUTI__ #include "I3DShUti.h" #endif //****** Globally Unique Ids ************************************************** DEFINE_GUID(IID_I3DExModule, 0x45bfb0a0, 0xba0f, 0x11cf, 0x99, 0x09, 0x00, 0x40, 0x05, 0x22, 0xbf, 0xcc); /*****************************************************************************\ * I3DExModule * * * * External modules interface * * * * * \*****************************************************************************/ /*****************************************************************************\ * Theory: * * Resources: In addition to the usual 'Comp' and 'PMAP' resources, you need to provide a 'Modu' resource of the same ID to specify parameters such as the 'MBAR' (Menu Bar) ID, the 'TBAR' (Tool Bar) ID, the Preferences 'View' ID, etc. See XAPI.r. * * Preferences: The Shell can read and write your Module Preferences data automatically from/to the Preferences file, and gives this data to your Module using the I3DExModule::SetPrefs() call just before calling I3DExModule::Edit(). 1. In the 'Modu' resource, choose a Preferences View ID and a 'Prfs' ID (the 'Prfs' resource contains the default values if a Preferences file has to be created from scratch by the Shell. To make a 'Prfs' resource, copy/paste the part of the Preferences File related to your Module into the 'Prfs' resource. 2. Build your Preferences View 3. Add to the Module's 'PMAP' the items of the View. You will note that the same PMAP is used for the Module's View and its Preferences. This is not a real problem as long as you use distinct IDs for the UI elements (buttons, check boxes, etc.). If you do not wish to have Preferences, put 0 in the Preferences View ID of the 'Modu' resource. * * Drag and drop from Tool Bar: * * \*****************************************************************************/ // Message constants for the Properties Palette (see OnMessagePropsCallBack of GetPropertiesInfo()) #define mShNewSelection 4000 #define mShSelectionChanged 4001 #define mShUpdateSelectionInfo 4002 #define mShApplyButton 4003 #define mShInvalidateCamera 4004 #define mShRestoreButton 4005 typedef void (*OnMessagePropsCallBack) (long messageID, long sourceID, PLATFORMEVENT* event, IShView* topView, void* privData); typedef void (*DrawNowPropsCallBack) (void* module); #undef INTERFACE #define INTERFACE I3DExModule DECLARE_INTERFACE_(I3DExModule, I3DExDataExchanger) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // I3DExtension methods STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE; STDMETHOD_(I3DExtension*, Clone) (THIS) PURE; // I3DExDataExchanger methods STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE; // Return NULL if GetResID is to be used STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE; STDMETHOD(ExtensionDataChanged) (THIS) PURE; STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE; STDMETHOD_(short, GetResID) (THIS) PURE; // I3DExModule methods STDMETHOD(SetPrefs) (THIS_ void* prefs) PURE; // 'prefs' is a pointer given by the Shell on the Module's Preferences data block STDMETHOD(Edit) (THIS_ IUnknown* element) PURE; STDMETHOD(Import) (THIS_ IUnknown* element, void* parameters) PURE; STDMETHOD(PrepareMenus) (THIS) PURE; STDMETHOD_(BOOLEAN, OnMenuAction) (THIS_ IShContext* context, long actionNumber) PURE; STDMETHOD_(BOOLEAN, OnKeyEvent) (THIS_ IShContext* context, PLATFORMEVENT* event) PURE; STDMETHOD(OnToolAction) (THIS_ IShContext* context, short oldTool, short newTool) PURE; STDMETHOD(Activate) (THIS_ IShContext* context, BOOLEAN entering) PURE; STDMETHOD(Update) (THIS_ IShContext* context, I3DShScene* scene, long change) PURE; STDMETHOD(Do) (THIS_ IShContext* context, ULONG message, void* data, void** result) PURE; STDMETHOD_(BOOLEAN, LaunchToolDragAndDrop) (THIS_ short tool) PURE; STDMETHOD_(BOOLEAN, GetZoomEffect) (THIS_ void* prevElem, void* nextElem, Boolean* zoomIn) PURE; STDMETHOD_(BOOLEAN, PropertiesChanged) (THIS) PURE; // Return TRUE if GetPropertiesInfo() should be called to update the the Properties Palette STDMETHOD_(BOOLEAN, GetPropertiesInfo) (THIS_ short& viewAndPMapID, void*& dataBuffer, void*& privData, BOOLEAN& forceShowProperties, OnMessagePropsCallBack& onMessageCallBack, // The External Module should return its View callback here DrawNowPropsCallBack drawNowPropsCallBack, void* module) PURE; // The Shell is giving this callback so that the External Modeler can redraw the Properties view immediately STDMETHOD(DoApplyProperties) (THIS_ IShContext* context, IShView* topView, void* privData) PURE; STDMETHOD(DoRestoreProperties) (THIS_ IShContext* context, IShView* topView, void* privData) PURE; }; #endif